home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 0104 / delphi.zip / LED25.PAS < prev    next >
Pascal/Delphi Source File  |  1996-01-17  |  7KB  |  177 lines

  1. {********************************************}
  2. {*                                          *}
  3. {*    LED25.PAS generated from LED25.VBX    *}
  4. {*                                          *}
  5. {********************************************}
  6.  
  7. unit Led25;
  8.  
  9. interface
  10.  
  11. uses SysUtils, Classes, Graphics, Forms, Controls, VBXCtrl, BIVBX;
  12.  
  13. { $DEFINE InitTLED}
  14. {^- Remove space to enable default init data -- See documentation. }
  15.  
  16. type
  17.  
  18.   { TLED }
  19.  
  20.   TLED = class(TVBXControl)
  21.   protected
  22.     { Event handler }
  23.     procedure HandleVBXEvent(var Message: TWMVBXFireEvent); override;
  24.     procedure DefineProperties(Filer: TFiler); override;
  25.   public
  26.     constructor Create(AOwner: TComponent); override;
  27.  
  28.     property Index: TVBInteger index 1 read GetIntProp;
  29.     property AVersion: Single index 13 read GetSingleProp write SetSingleProp;
  30.     property Redraw: Boolean index 44 read GetBoolProp write SetBoolProp;
  31.     property ZLoad: TVBInteger index 46 read GetIntProp write SetIntProp;
  32.   published
  33.     property BackColor: TColor index 3 read GetColorProp write SetColorProp;
  34.     property Enabled;
  35.     property Visible;
  36.     property TabOrder;
  37.     property TabStop;
  38.     property About: TVBString index 14 read GetStringProp {NoRT}write
  39.       SetStringProp stored False;
  40.     property DecayRate: TVBInteger index 15 read GetIntProp write SetIntProp;
  41.     property MaxDecay: Boolean index 16 read GetBoolProp write SetBoolProp;
  42.     property BevelWidth: TVBInteger index 17 read GetIntProp write SetIntProp;
  43.     property BevelInner: TVBEnum index 18 read GetEnumProp write SetEnumProp;
  44.     property BevelOuter: TVBEnum index 19 read GetEnumProp write SetEnumProp;
  45.     property BorderWidth: TVBInteger index 20 read GetIntProp write
  46.       SetIntProp;
  47.     property Value: TVBLongint index 21 read GetLongProp write SetProp;
  48.     property LEDColor: TVBEnum index 22 read GetEnumProp write SetEnumProp
  49.       stored False;
  50.     property LEDIndex: TVBInteger index 23 read GetIntProp write SetIntProp;
  51.     property LEDStatus: TVBEnum index 24 read GetEnumProp write SetEnumProp
  52.       stored False;
  53.     property Mode: TVBEnum index 25 read GetEnumProp write SetEnumProp;
  54.     property NumLEDs: TVBInteger index 26 read GetIntProp write SetIntProp;
  55.     property LEDWidth: TVBInteger index 27 read GetIntProp write SetIntProp;
  56.     property LEDHeight: TVBInteger index 28 read GetIntProp write SetIntProp;
  57.     property LEDSep: TVBInteger index 29 read GetIntProp write SetIntProp;
  58.     property LEDStyle: TVBEnum index 30 read GetEnumProp write SetEnumProp;
  59.     property BorderHorizontal: TVBInteger index 31 read GetIntProp write
  60.       SetIntProp;
  61.     property BorderVertical: TVBInteger index 32 read GetIntProp write
  62.       SetIntProp;
  63.     property Orientation: TVBEnum index 33 read GetEnumProp write SetEnumProp;
  64.     property Direction: TVBEnum index 34 read GetEnumProp write SetEnumProp;
  65.     property OnPictureRed: TVBPic index 35 read GetPictureProp write
  66.       SetPictureProp stored False;
  67.     property OnPictureYellow: TVBPic index 36 read GetPictureProp write
  68.       SetPictureProp stored False;
  69.     property OnPictureGreen: TVBPic index 37 read GetPictureProp write
  70.       SetPictureProp stored False;
  71.     property OffPictureRed: TVBPic index 38 read GetPictureProp write
  72.       SetPictureProp stored False;
  73.     property OffPictureYellow: TVBPic index 39 read GetPictureProp write
  74.       SetPictureProp stored False;
  75.     property OffPictureGreen: TVBPic index 40 read GetPictureProp write
  76.       SetPictureProp stored False;
  77.     property AutoSize: TVBEnum index 41 read GetEnumProp write SetEnumProp;
  78.     property MouseControl: Boolean index 42 read GetBoolProp write
  79.       SetBoolProp;
  80.     property BackgroundPicture: TVBPic index 43 read GetPictureProp write
  81.       SetPictureProp stored False;
  82.     property AutoRedraw: Boolean index 45 read GetBoolProp write SetBoolProp;
  83.     property OnClick;
  84.     property OnEnter;
  85.     property OnExit;
  86.     property OnMouseDown;
  87.     property OnMouseMove;
  88.     property OnMouseUp;
  89.   end;
  90.  
  91. procedure Register;
  92.  
  93. implementation
  94.  
  95. { Default form data for TLED }
  96.  
  97. {$IFDEF InitTLED}
  98.  
  99. const
  100.   TLEDInitLen = 293;
  101.  
  102. procedure TLEDInitData; near; assembler;
  103. asm
  104.     DB    $00,$03,$4C,$45,$44,$01,$00,$00,$03,$C0,$C0,$C0,$00,$04,$08,$FF
  105.     DB    $FF,$09,$FF,$FF,$0A,$00,$00,$0B,$00,$00,$0C,$00,$0D,$00,$00,$20
  106.     DB    $40,$0F,$00,$00,$10,$00,$00,$11,$02,$00,$12,$01,$13,$02,$14,$02
  107.     DB    $00,$15,$00,$00,$00,$00,$17,$00,$00,$19,$01,$1A,$01,$00,$1B,$14
  108.     DB    $00,$1C,$14,$00,$1D,$02,$00,$1E,$00,$1F,$05,$00,$20,$05,$00,$21
  109.     DB    $00,$22,$00,$29,$00,$2A,$00,$00,$2D,$FF,$FF,$2E,$00,$00,$00,$00
  110.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  111.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  112.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  113.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  114.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  115.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  116.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  117.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  118.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  119.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  120.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  121.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  122.     DB    $00,$00,$00,$00,$FF
  123. end;
  124.  
  125. {$ENDIF}
  126.  
  127. { TLED }
  128.  
  129. constructor TLED.Create(AOwner: TComponent);
  130. begin
  131.   FVBXFile := StrNew('LED25.VBX');
  132.   FVBXClass := StrNew('LED');
  133.   SetBounds(0, 0, 80, 32);
  134.   inherited Create(AOwner);
  135.   ControlStyle := ControlStyle - [csCaptureMouse, csClickEvents];
  136.   TabStop := True;
  137.   FVBXFlags := [vfLoadMessage];
  138.   {$IFDEF InitTLED}
  139.   FHForm := VBXCreateFormFile(TLEDInitLen, @TLEDInitData);
  140.   {$ENDIF}
  141. end;
  142.  
  143. procedure TLED.HandleVBXEvent(var Message: TWMVBXFireEvent);
  144. begin
  145.   case Message.VBXEvent^.EventIndex of
  146.     0: DispatchNotifyEvent(OnClick);
  147.     1: begin end; { VCL Handles OnGotFocus }
  148.     2: begin end; { VCL Handles OnLostFocus }
  149.     3: DispatchMouseEvent(OnMouseDown, Message);
  150.     4: DispatchMouseMoveEvent(OnMouseMove, Message);
  151.     5: DispatchMouseEvent(OnMouseUp, Message);
  152.   end;
  153. end;
  154.  
  155. procedure TLED.DefineProperties(Filer: TFiler);
  156. begin
  157.   inherited DefineProperties(Filer);
  158.   HandleProperty('AVersion', Filer, 13);
  159.   HandleBinaryProperty('OnPictureRed_Data', Filer, 35);
  160.   HandleBinaryProperty('OnPictureYellow_Data', Filer, 36);
  161.   HandleBinaryProperty('OnPictureGreen_Data', Filer, 37);
  162.   HandleBinaryProperty('OffPictureRed_Data', Filer, 38);
  163.   HandleBinaryProperty('OffPictureYellow_Data', Filer, 39);
  164.   HandleBinaryProperty('OffPictureGreen_Data', Filer, 40);
  165.   HandleBinaryProperty('BackgroundPicture_Data', Filer, 43);
  166.   HandleBinaryProperty('ZLoad', Filer, 46);
  167. end;
  168.  
  169. { Designer registration }
  170. procedure Register;
  171. begin
  172.   RegisterComponents('VBX', [
  173.     TLED]);
  174. end;
  175.  
  176. end.
  177.